import requests

# 添加用户
resp = requests.post(url="http://116.62.53.189:48080/admin-api/system/user/create",
                     headers={"content-type": "application/json",
                              "Authorization": "Bearer 876fa56a7f8f4c9f9f6a49b1afcffab0"},
                     json={"nickname": "测试", "deptId": "", "mobile": "19811796706", "email": "", "username": "ceshi111",
                           "password": "123456", "postIds": [], "remark": "", "status": 0, "roleIds": []})
print("添加用户:", resp.json())

# 查询用户
resp = requests.get(url="http://116.62.53.189:48080/admin-api/system/user/get?id=141",
                    headers={"Authorization": "Bearer 876fa56a7f8f4c9f9f6a49b1afcffab0"})
print("查询用户:", resp.json())

# 修改员工
resp = requests.put(url="http://116.62.53.189:48080/admin-api/system/user/update",
                    headers={"Content-type": "application/json",
                             "Authorization": "Bearer 876fa56a7f8f4c9f9f6a49b1afcffab0"},
                    json={"id": 141, "no": None, "username": "ceshiJXZ", "nickname": "ABC", "remark": "",
                          "deptId": None, "deptName": None, "postIds": [], "postName": None, "email": "",
                          "mobile": "19811796795", "sex": 0, "avatar": "", "status": 0, "loginIp": "",
                          "loginDate": None, "createTime": 1760769481000})
print("修改员工:", resp.json())

# 删除员工
resp = requests.delete(url="http://116.62.53.189:48080/admin-api/system/user/delete?id=141",
                       headers={"Authorization": "Bearer 876fa56a7f8f4c9f9f6a49b1afcffab0"})
print("删除员工:", resp.json())
#测试
